<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="include/menu.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript" src="include/jquery-latest.js"></script>
<script type="text/javascript">
$(document).ready(function(){

	$("ul.subnav").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled - Adds empty span tag after ul.subnav

	$("ul.topnav li span").hover(function() { //When trigger is clicked...

		//Following events are applied to the subnav itself (moving subnav up and down)
		$(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click

		$(this).parent().hover(function() {
		}, function(){
			$(this).parent().find("ul.subnav").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
		});

		//Following events are applied to the trigger (Hover events for the trigger)
		}).hover(function() {
			$(this).addClass("subhover"); //On hover over, add class "subhover"
		}, function(){	//On Hover Out
			$(this).removeClass("subhover"); //On hover out, remove class "subhover"
	});

});
</script>
</head>
<?php
require_once '/function/function.php';
if (!defined('WEB_ROOT')) {
	exit;
}
?>
<body>
<div id=header>
    	<ul class=topnav>
        	<li><a href="index.php">Trang chủ</a></li>
			
            <li><a>Sản phẩm</a>
                <ul class=subnav>
					<?php productMenuList(); ?>
                </ul> </li>			
				
                <li><a href="index.php?pa=diendan">Diễn đàn</a></li>
				
				<li> <a>Tin tức</a>
				<ul class=subnav>
					<li> <a href="index.php?pa=tintuc&tt=0" >Tất cả</a></li>
					<li> <a href="index.php?pa=tintuc&tt=-1"> Theo chủ đề</a></li>
                </ul></li>
				
                       
                <li><a>Liên hệ</a> 				
				<ul class=subnav>
					<li><a href="index.php?pa=lienhe&lh=ad">Adminstrator</a></li>
					<li><a href="index.php?pa=lienhe&lh=su">Super-Modorator</a></li>
					<li><a href="index.php?pa=lienhe&lh=mo">Modorator</a></li>					
				</ul></li>
                
                <?php if(!isset($_SESSION['user_id'])){ ?>
                <li><a href="index.php?pa=dangky">Đăng ký</a></li>
                <?php } ?>
				
				<li><?php if (isset($_SESSION['user_id'])) {
							if ($_SESSION['group_id'] == '1' ) { ?>
								<a>Xin chào <font color="#0099FF"><?php echo $_SESSION['user_name'];?> </font> </a>
								<ul class="subnav">
									<li><a href="admin/index.php">Quản Lý Shop</a></li>
									<li><a href="index.php?action=dangxuat"><font color="#0099FF"> Đăng xuất</font></a></li></ul>
							<?php }	else { ?>                        	
									<a>Xin chào <?php echo $_SESSION['user_name'].',';?></a> <a href="index.php?action=dangxuat"><font color="#0099FF"> Đăng xuất</font></a>
						<?php } } else {?>
				<a href="index.php?pa=dangnhap">Đăng nhập</a>
				<?php } ?>
				</li>
        </ul>        
</div>
</body>
</html>